﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Web.UI;
using UDS.Components;

namespace UDS.SubModule.CM
{
    /// <summary>
    /// LinkmanListView 的摘要说明。
    /// </summary>
    public partial class LinkmanListViewPage : Page
    {
        protected override void OnLoad(EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                var cm = new Components.CM();
                SqlDataReader dr = cm.GetAllLinkman();
                DataTable dt = Tools.ConvertDataReaderToDataTable(dr);
                dgrd_Linkman.DataSource = dt.DefaultView;
                dgrd_Linkman.DataBind();
                ltl_Count.Text = dt.Rows.Count.ToString();
            }

            base.OnLoad(e);
        }

        protected static string GetGender(bool sex)
        {
            return sex ? "男" : "女";
        }
    }
}